function xjs=refh(hs,Ni)
%
%         xjs=refh(hs,N)
%
%  una grupo de valores de hs =[1,4,6,1];
%   

N = length(hs);
psi  = (0:N-1)'/(N-1);
psii = (0:Ni-1)'/(Ni-1);

hsi = interp1(psi,hs,psii);

A = diag(ones(Ni,1),0)-diag(ones(Ni-1,1),-1);
x0 = zeros(Ni,1);

rhs = [hsi-A(:,1).*x0];
A(:,1)=[];
A(1,:)=[];
rhs(1)=[];

xjs = A\rhs;
xjs = [x0(1);xjs];
xjs = xjs/max(xjs);